home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 2_4.lha / 2_4 / 2_4.c next >
Text File  |  1993-08-08  |  1KB  |  36 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / print the sizes of all of the fundamental types
  6. include <stream.h>
  7.  
  8. include "2_4a.c"        /* EXPAND */
  9.  
  10. nt main(int, char**)
  11.  
  12.    pr("char", sizeof(char));
  13.    pr("short", sizeof(short));
  14.    pr("int", sizeof(int));
  15.    pr("long", sizeof(long));
  16.    pr("unsigned char", sizeof(unsigned char));
  17.    pr("unsigned short", sizeof(unsigned short));
  18.    pr("unsigned int", sizeof(unsigned int));
  19.    pr("unsigned long", sizeof(unsigned long));
  20.    pr("float", sizeof(float));
  21.    pr("double", sizeof(double));
  22.    pr("void *", sizeof(void *));
  23.    pr("char *", sizeof(char *));
  24.    pr("short *", sizeof(short *));
  25.    pr("int *", sizeof(int *));
  26.    pr("long *", sizeof(long *));
  27.    pr("unsigned char *", sizeof(unsigned char *));
  28.    pr("unsigned short *", sizeof(unsigned short *));
  29.    pr("unsigned int *", sizeof(unsigned int *));
  30.    pr("unsigned long *", sizeof(unsigned long *));
  31.    pr("float *", sizeof(float *));
  32.    pr("double *", sizeof(double *));
  33.    pr("int (*)()", sizeof(int (*)()));
  34.    return 0;
  35.  
  36.